<?php 
$docRoot = $_SERVER['DOCUMENT_ROOT'].'/'.strtok($_SERVER['PHP_SELF'], '/');
include_once ($docRoot."/application/service/feed/parser/impl/ScoresParserImpl.php") 
?>
<?php

//get the request form view page create url and send to parser for getting html
//and return the html to view page
class ScoreController {
    
    /**
     * 
     * Enter description here ...
     * @param unknown_type $scoreType
     * @param unknown_type $scoreId
     */
	public static function loadScoreHtml($scoreType,$scoreId){
		$scoreParser = new ScoresParserImpl();
		
		$feedUrl = ScoreController::getFeedUrl($scoreType,$scoreId);
				
		$scoreParser->setFeedUrl($feedUrl);
		return $scoreParser->getFeedHtml();
	}
	
	private static function  getFeedUrl($scoreType,$scoreId){
		if ($scoreType == "live"){
			return "D:/wamp/www/everythinghockey/test/feeds/home.xml"; 
		}elseif ($scoreType == "over"){
			return "D:/wamp/www/everythinghockey/test/feeds/italy.xml";
		}elseif ($scoreType == "shedule"){
			return "D:/wamp/www/everythinghockey/test/feeds/italy_shedule.xml";
		}else {
			return "404";
		}
	}
   
}

?>